package com.yequan.thread.threadpool.mythreadpoolmanager;


/**
 * 线程池管理类工厂
 *
 * @author yequan
 * @date 2019/12/02
 */
public final class ThreadPoolManagerFactory {

    private ThreadPoolManagerFactory() {
    }

    /**
     * 构建cpu密集型线程池
     *
     * @return
     */
    public static CustomThreadPoolManager newCpuIntensiveThreadPoolManager() {
        return CpuIntensiveThreadPoolManager.getInstance().getCustomThreadPoolManager();
    }

    /**
     * 构建IO密集型线程池
     *
     * @return
     */
    public static CustomThreadPoolManager newIoIntensiveThreadPoolManager() {
        return IoIntensiveThreadPoolManager.getInstance().getCustomThreadPoolManager();
    }

    public static CustomThreadPoolManager newSingleThreadPoolManager() {
        return SingleThreadPoolManager.getInstance().getCustomThreadPoolManager();
    }
}
